﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Common.Base
{
    /// <summary>
    /// 实体基类
    /// </summary>
    public abstract class BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        // [MaxLength(36)]
        [Column("key_id")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public long? KeyId { get; set; } = 0;

        /// <summary>
        /// 创建人
        /// </summary>
        // [MaxLength(36)]
        [Column("create_user_id")]
        public long? CreateUserId { get; set; }

        /// <summary>
        /// 最后更新人
        /// </summary>
        // [MaxLength(36)]
        [Column("update_user_id")]
        public long? UpdateUserId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        [Column("update_time")]
        public DateTime UpdateTime { get; set; }

        /// <summary>
        /// 逻辑删除标识
        /// </summary>
        [Column("is_deleted")]
        public sbyte IsDeleted { get; set; }
    }
}